package com.application.lucky.activity.me;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.application.lucky.R;
import com.application.lucky.activity.WebViewActivity;
import com.application.lucky.activity.ZCodeActivity;
import com.application.lucky.request.nav.UrlManager;
import com.application.lucky.widget.TitlebarView;
import com.application.mylibrary.base.BaseActivity;

public class DaiLiActivity extends BaseActivity implements View.OnClickListener {

    private TitlebarView mTitleBar;
    private TextView mTvDailiSm;
    private TextView mTvDailiHb;
    private TextView mTvDailiWj;
    private TextView mTvZcode;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        initView();
    }

    @Override
    public void beforeInit() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_dai_li;
    }

    private void initView() {
        mTitleBar = findViewById(R.id.title_bar);
        mTitleBar.setOnViewClick(new TitlebarView.onViewClick() {
            @Override
            public void leftClick() {
                finishAnim();
            }

            @Override
            public void rightClick() {

            }
        });
        mTvDailiSm = findViewById(R.id.tv_daili_sm);
        mTvDailiSm.setOnClickListener(this);
        mTvDailiHb = findViewById(R.id.tv_daili_hb);
        mTvDailiWj = findViewById(R.id.tv_daili_wj);
        mTvZcode = findViewById(R.id.tv_zcode);
        mTvDailiWj.setOnClickListener(this);
        mTvDailiHb.setOnClickListener(this);
        mTvZcode.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_daili_sm:
//                ToastUtils.show("点击了说明");
                Intent intent = new Intent(this, WebViewActivity.class);
                intent.putExtra("url", UrlManager.getInviteurl());
                startActivityAnim(intent);
                break;
            case R.id.tv_daili_wj:
                Intent myPlayer = new Intent(this, MyPlayerActivity.class);
                startActivityAnim(myPlayer);
                break;
            case R.id.tv_daili_hb:
                startActivityAnim(new Intent(this, ZCodeActivity.class));
                break;
            case R.id.tv_zcode:
                Intent nickIntent = new Intent(DaiLiActivity.this, ZCodeActivity.class);
                startActivity(nickIntent);
                break;
            default:
                break;
        }
    }
}
